import 'package:plugin_platform_interface/plugin_platform_interface.dart';

import 'sub_sdk.dart';
import 'submail_one_login_plugin_method_channel.dart';

abstract class SubmailOneLoginPluginPlatform extends PlatformInterface {
  /// Constructs a SubmailOneLoginPluginPlatform.
  SubmailOneLoginPluginPlatform() : super(token: _token);

  static final Object _token = Object();

  static SubmailOneLoginPluginPlatform _instance =
      MethodChannelSubmailOneLoginPlugin();

  /// The default instance of [SubmailOneLoginPluginPlatform] to use.
  ///
  /// Defaults to [MethodChannelSubmailOneLoginPlugin].
  static SubmailOneLoginPluginPlatform get instance => _instance;

  /// Platform-specific implementations should set this with their own
  /// platform-specific class that extends [SubmailOneLoginPluginPlatform] when
  /// they register themselves.
  static set instance(SubmailOneLoginPluginPlatform instance) {
    PlatformInterface.verifyToken(instance, _token);
    _instance = instance;
  }

  /// [init] 初始化sdk
  Future<dynamic> init(
      {SubPlatformConfig? androidConfig,
      SubPlatformConfig? iosConfig,
      bool debug = false,
      int timeout = 60}) {
    throw UnimplementedError('platformVersion() has not been implemented.');
  }

  /// [getLoginAccessCode] 预取号
  Future<dynamic> getLoginAccessCode() {
    throw UnimplementedError('platformVersion() has not been implemented.');
  }

  /// [getLoginToken] 获取 token
  Future<dynamic> getLoginToken() {
    throw UnimplementedError('platformVersion() has not been implemented.');
  }

  /// [close] 关闭页面
  Future<void> close() {
    throw UnimplementedError('platformVersion() has not been implemented.');
  }

  /// [getNetworkType] 获取⽹络状态和运营商类型
  /// ⽹络类型：0-未知、1-数据流量、2-纯WiFi、3-流量+WiFi
  Future<int?> getNetworkType() {
    throw UnimplementedError('platformVersion() has not been implemented.');
  }

  /// [getOperatorType] 获取⽹络状态和运营商类型
  /// 运营商类型：0-未知；1-移动；2-联通；3-电信
  Future<int?> getOperatorType() {
    throw UnimplementedError('platformVersion() has not been implemented.');
  }

  /// [delScrip] 删除取号缓存
  Future<void> delScrip() {
    throw UnimplementedError('platformVersion() has not been implemented.');
  }

  Future<dynamic> getPhoneNumber() {
    throw UnimplementedError('platformVersion() has not been implemented.');
  }
}
